public interface Integer {

  void release () throws Exception;

  int cmp (Integer other) throws Exception;

  Integer add (Integer other) throws Exception;

  Integer sub (Integer other) throws Exception;

  Integer mul (Integer other) throws Exception;

  Integer div (Integer other) throws Exception;

  Integer mod (Integer other) throws Exception;

  Integer neg () throws Exception;

  Integer abs () throws Exception;

  Integer pow (int exp) throws Exception;

  Meta meta () throws Exception;


  class Meta {
    int sign;
    String value;

    @Override
    public boolean equals (Object other) {
      Meta lhs = this;
      Meta rhs = (Meta)other;
      if (lhs.sign != rhs.sign)
        return false;
      return lhs.value.equals(rhs.value);
    }

    @Override
    public String toString () {
      return String.format("{ sign: %d, value: %s }", sign, value);
    }
  }
}
